package br.com.intelsys.basics.dao.hiber;

import org.hibernate.exception.ConstraintViolationException;

import br.com.intelsys.basics.dao.DaoException;

public class HibernateDaoException extends DaoException {

	private static final long serialVersionUID = -1313533753885630085L;
	private Exception e;

	public HibernateDaoException(Exception e) {
		super(e);
		this.e = e;
	}

	public HibernateDaoException(int errorMessageCode, String errorMessage) {
		super(errorMessageCode, errorMessage);
	}

	public boolean isConstraintViolation() {
		return e instanceof ConstraintViolationException;
	}

}
